package com.test;

import java.util.Arrays;

public class Teacher extends User {
    /**
     * 课程
     */
    private String[] courses;
    /**
     * 班级
     */
    private Grade[] grades;

    public Teacher() {

    }

    public Teacher(String name, int age,
                   String[] courses, Grade[] grades) {
        super(name, age);
        this.courses = courses;
        this.grades = grades;
    }

    public String[] getCourses() {
        return courses;
    }

    public void setCourses(String[] courses) {
        this.courses = courses;
    }

    public Grade[] getGrades() {
        return grades;
    }

    public void setGrades(Grade[] grades) {
        this.grades = grades;
    }

    /* 自动生成之后需要手动补全父类的2个属性 */
    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + getName() + '\'' +
                ", age=" + getAge() +
                ", courses=" + Arrays.toString(courses) +
                ", grades=" + Arrays.toString(grades) +
                '}';
    }

    @Override
    void code(String app) {
        System.out.println("老师使用" + app + "编写代码");
    }
}
